FROM tomcat:8-jre8

LABEL maintainer="Zeliu Ao <aozeliu@gmail.com>"

COPY /build/jpetstore.war jpetstore.war

RUN rm -rf /usr/local/tomcat/webapps \
    && mkdir -p /usr/local/tomcat/webapps \
    && unzip jpetstore.war -d /usr/local/tomcat/webapps/jpetstore \
    && rm -rf jpetstore.war

COPY context.xml /usr/local/tomcat/conf/

CMD [ "catalina.sh", "run" ]
